package org.leslie.controller;

import org.leslie.pojo.User;
import org.leslie.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserController {

   @Autowired
   private UserService userService;

    @RequestMapping(value = "/findById",method = RequestMethod.GET)
    public User findById(@RequestParam("id") Integer id){
        System.out.println(id);
        return userService.findById(id);
    }
}
